KEYENCE_KV_LE21V  communication driver

 

KEYENCE_KV_LE21V communication driver is the driver to communicate with invert of KEYENCE_KV_LE21V Controller.

 

1. Read Settings

 

<Figure 1> is read setting example of KEYENCE_KV_LE21V communication driver.

<Figure 1>  Read setting example of KEYENCE_KV_LE21V communication driver

 

Device part of  <Figure 1> input Device type(TCP/IP), IP address of PLC(192.168.1.86), service port of TCP/IP ( 8501 ),respectively, according to setting of server.

 

 

KEYENCE_KV_LE21V communication driver read schedule

When writing the READ, when the first argument is written as READ and DWORD, the value is stored in the WORD DWORD without any distinction.

 

READ Station  (not used) Command(Device type. Data type) Device Number (only read Data) Memory Address Number of read
READ, 1, ?E, 0, 0, 1,
READ, 1, ?M, 0, 1, 1,
READ, 1, DM.U, 100, 10, 10,
READ, 1, R.U 0, 1, 1,
READ 1, T.D 0, 10, 1,

 

1) STATION            not used.

2) Command          Error Check (?E), Mode Check (?M), Read Data (Device Type. Data Type) <table 1>

         (Data type In case of T, C, CTC, CTH, three values of contact, current value and set value are entered, and the number of data is read three times than the set number.)

3) Device Number   Device start address.

4) Memory Address Buffer location to store the read state value.

5) Number of read

Number of data that can be requested at one time  -   .U -> 170
                                                                          .D -> 94

Device Type Device No. Data type
R 00000~99915 00000~59915 00000~59915 .U
B 0000~3FFFF .U
MR 00000~99915 00000~99915 .U
LR 00000~99915 00000~99915 .U
CR 0000~3915 0000~3915 0000~3915 .U
VB 0000~3FFFF .U
DM 00000~65534 00000~65534 00000~19999 .U
EM 00000~65534 00000~65534 .U
FM 00000~32767 00000~32766 .U
ZF 000000~131071 .U
W 0000~3FFFF .U
TM 000~511 000~511 000~511 .U
Z 01~12 01~12 .U
T 0000~39999 0000~39999 000~511 .D
TC 0000~39999 0000~39999 000~511 .D
TS 0000~39999 0000~39999 000~511 .D
C 0000~39999 0000~39999 000~511 .D
CC 0000~39999 0000~39999 000~511 .D
CS 0000~39999 0000~39999 000~511 .D
CTH 0~1 0~1 0~1 .D
CTC 0~3 0~3 0~3 .D
AT 0~7 0~7 0~7 .D
CM 0000~5999 0000~5999 0000~5999 .U
VM 00000~59999 .U

<table 1> KEYENCE_KV_LE21V Device setting table

 

2. Write settings

 

Digital Write

Digital write setting parameters are as follows:

1) PORT             port no.

2) STATION        not used.

3) ADDRESS       Device np.

4) Extra1           Command

change mode(M), error clear(ER), set(ST), reset(RS),
write data(WR.Device type.Data type) <table1>

5) Extra2            not used.

6) Value            1 , 0

 

Analog Write 

Analog write setting parameters are as follows:

1) PORT             port no.

2) STATION        not used.

3) ADDRESS       Device np.

4) Extra1           Command

change mode(M), error clear(ER), set(ST), reset(RS),
set time(WRT) value fixed 13digits Ex)1901271223056(year2,month2,day2,hour2,minute2,sec2,day of the week1)
write data(WR.Device type.Data type) <table1>

5) Extra2            not used.

6) Value            control value

 

Write example 1)

 

ex1) Port : 0  Station : 0  Address : 0000  Extra1 : WRT, EXTRA2 : If set to blank and analog output, the time of the device connected to port 0 can be changed to the output value (13 digits).

 

ex2) Port : 0  Station : 0  Address : 0121  Extra1 : WR.DM.U, EXTRA2 : If set to blank and analog output is performed, the contents of the data memory (DM) 122 (121) of the device connected to port 0 can be changed to the output value (.U) according to the specified data format.